package de.hhkk.view.auswertung;

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;

import de.hhkk.controller.NavigationController;

public class UIAuslastung extends Composite
{
    private Table table;
    private Text  text;
    private Text  text_1;

    /**
     * Create the composite.
     * @param parent
     * @param style
     */
    public UIAuslastung(Composite parent, int style, String title)
    {
        super(parent, style);
        setLayout(new FillLayout(SWT.HORIZONTAL));

        TabFolder tabFolder = new TabFolder(this, SWT.NONE);
        tabFolder.setBounds(0, 0, 122, 43);

        TabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);
        tbtmNewItem.setText("Auslastung");

        Composite composite = new Composite(tabFolder, SWT.NONE);
        tbtmNewItem.setControl(composite);
        composite.setLayout(new GridLayout(1, false));

        Group group = new Group(composite, SWT.NONE);
        GridData gd_group = new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1);
        gd_group.heightHint = 133;
        gd_group.widthHint = 660;
        group.setLayoutData(gd_group);
        group.setText("Suchkriterien");
        group.setBounds(0, 0, 650, 227);
        group.setLayout(new GridLayout(6, false));

        Label label = new Label(group, SWT.NONE);
        label.setText("Name");

        text = new Text(group, SWT.BORDER);
        GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
        gd_text.widthHint = 140;
        text.setLayoutData(gd_text);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);

        Label label_1 = new Label(group, SWT.SEPARATOR);
        label_1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 4));
        new Label(group, SWT.NONE);

        Label lblKursnr = new Label(group, SWT.NONE);
        lblKursnr.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        lblKursnr.setText("Kurs-Nr.");

        text_1 = new Text(group, SWT.BORDER);
        GridData gd_text_1 = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
        gd_text_1.widthHint = 67;
        text_1.setLayoutData(gd_text_1);
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        
                Button button = new Button(group, SWT.NONE);
                button.setText("Suchen");

        Label lblZeigeAn = new Label(group, SWT.NONE);
        lblZeigeAn.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        lblZeigeAn.setText("Zeige an");

        Combo combo = new Combo(group, SWT.NONE);
        combo.setItems(new String[]{"Auslastung", "Anzahl Teilnehmer", "Dauer der Kurse", "Eins\u00E4tze pro Saison",
                "Kursdauer", "Kurssprache"});
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
        new Label(group, SWT.NONE);
        new Label(group, SWT.NONE);
        
        Button button_1 = new Button(group, SWT.NONE);
        button_1.setText("Zur\u00FCcksetzen");

        Label label_8 = new Label(group, SWT.NONE);
        label_8.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));

        Label label_9 = new Label(group, SWT.NONE);
        GridData gd_label_9 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
        gd_label_9.widthHint = 69;
        label_9.setLayoutData(gd_label_9);
        Label label_3 = new Label(group, SWT.NONE);
        label_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        Label label_6 = new Label(group, SWT.NONE);
        label_6.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
        new Label(group, SWT.NONE);

        Group group_1 = new Group(composite, SWT.NONE);
        group_1.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
        group_1.setText("Trefferliste");
        group_1.setBounds(0, 0, 650, 252);
        group_1.setLayout(new GridLayout(1, false));

        TableViewer tableViewer = new TableViewer(group_1, SWT.BORDER | SWT.FULL_SELECTION);
        table = tableViewer.getTable();
        table.setLinesVisible(true);
        table.setHeaderVisible(true);
        GridData gd_table = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1);
        gd_table.widthHint = 657;
        gd_table.heightHint = 203;
        table.setLayoutData(gd_table);

        TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tblclmnKursnr = tableViewerColumn.getColumn();
        tblclmnKursnr.setWidth(72);
        tblclmnKursnr.setText("Kurs-Nr.");
        tblclmnKursnr.setResizable(true);
        tblclmnKursnr.setMoveable(true);

        TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tableColumn_1 = tableViewerColumn_1.getColumn();
        tableColumn_1.setWidth(94);
        tableColumn_1.setText("Name");
        tableColumn_1.setResizable(true);
        tableColumn_1.setMoveable(true);

        TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tblclmnAuslastungMa = tableViewerColumn_2.getColumn();
        tblclmnAuslastungMa.setWidth(107);
        tblclmnAuslastungMa.setText("Auslastung MA %");
        tblclmnAuslastungMa.setResizable(true);
        tblclmnAuslastungMa.setMoveable(true);

        TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tblclmnAuslastungKurs = tableViewerColumn_3.getColumn();
        tblclmnAuslastungKurs.setWidth(100);
        tblclmnAuslastungKurs.setText("Auslastung Kurs %");
        tblclmnAuslastungKurs.setResizable(true);
        tblclmnAuslastungKurs.setMoveable(true);

        TableViewerColumn tableViewerColumn_4 = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tblclmnDauerDesKurses = tableViewerColumn_4.getColumn();
        tblclmnDauerDesKurses.setWidth(100);
        tblclmnDauerDesKurses.setText("Dauer des Kurses");
        tblclmnDauerDesKurses.setResizable(true);
        tblclmnDauerDesKurses.setMoveable(true);

        TableViewerColumn tableViewerColumn_5 = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tblclmnKurssprache = tableViewerColumn_5.getColumn();
        tblclmnKurssprache.setWidth(100);
        tblclmnKurssprache.setText("Kurssprache");
        tblclmnKurssprache.setResizable(true);
        tblclmnKurssprache.setMoveable(true);

        TableViewerColumn tableViewerColumn_6 = new TableViewerColumn(tableViewer, SWT.NONE);
        TableColumn tblclmnTeilnehmerzahl = tableViewerColumn_6.getColumn();
        tblclmnTeilnehmerzahl.setWidth(100);
        tblclmnTeilnehmerzahl.setText("Teilnehmerzahl");
        tblclmnTeilnehmerzahl.setResizable(true);
        tblclmnTeilnehmerzahl.setMoveable(true);
        
                Button btnSchliessen = new Button(composite, SWT.NONE);
                btnSchliessen.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
                btnSchliessen.addSelectionListener(new SelectionAdapter()
                {
                    @Override
                    public void widgetSelected(SelectionEvent e)
                    {
                        NavigationController.getInstance().clear();
                        dispose();
                    }
                });
                btnSchliessen.setText("Schlie\u00DFen");

    }

    @Override
    protected void checkSubclass()
    {
        // Disable the check that prevents subclassing of SWT components
    }
}
